#!/sbin/openrc-run

# Copyright 2010-2022 Funtoo Solutions, Inc.
# All rights reserved. Released under the 2-clause BSD license.

depend() {
    provide net
}

start() {
    ebegin "Bringing up network interface lo"
    ip addr add 127.0.0.1/8 dev lo brd + scope host
    ip route add 127.0.0.0/8 dev lo scope host
    ip link set lo up
    eend $?
}

stop() {
    ebegin "Shutting down network interface lo"
    ip route del 127.0.0.0/8 dev lo scope host
    ip addr del 127.0.0.1/8 dev lo
    ip link set lo down
    eend $?
}
